home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 425_01 / tar / tar.txt < prev    next >
Text File  |  1980-07-23  |  26KB  |  659 lines

  1. 'tar' - is an acronym for 'tape archiver'
  2.  
  3. It is a tool to save files to archive media and restore them back
  4. again. Despite of its name, the program handles many media types,
  5. be it a floppy disk or regular file.
  6.  
  7. The program was initially written for UNIX operating system, but
  8. since many other OS support its format, tar became a useful tool
  9. for information exchange between different platforms.
  10.  
  11. This document describes yet another implementation of the program,
  12. which could be noted for portability between MS-DOS and UNIX
  13. clones, portability both in data format and source text level.
  14.  
  15.  
  16.         System requirements
  17.  
  18. Program will execute
  19.  - on any IBM PC compatible computer running MS-DOS 3.0 or
  20.    compatible OS;
  21.  - any generic UNIX clone.
  22.  
  23. Before running the program you will probably have to compile it,
  24. especially if you are a UNIX user. To do that you should have:
  25.  - any C compiler compatible with K&R or ANSI standard - for
  26.    UNIX version;
  27.  - Turbo C v2.0 under MS-DOS 3.30 - for DOS version.
  28.  
  29. Declaring such a wide portability shall probably have some
  30. restrictions, but, alas, I do not know about them.
  31.  
  32. The size of free memory required for program depends of the action
  33. selected. As a rule, about 64K bytes is enough to read/write
  34. archives without compression. If you are going to use compression
  35. options, the program can take all the megabytes available.
  36.  
  37. Anyway, the program will be able to process archive in a regular
  38. file (see below). It also supports floppy diskettes under MS-DOS.
  39. Media types available under UNIX is determined by device drivers
  40. available in the system.
  41.  
  42.  
  43.         Running the program
  44.  
  45. The program can be run simply from command line. You have to type
  46. to the system prompt a line with the following syntax:
  47.  
  48.         Tar <options> <args> <file> ...
  49.  
  50. where options define both action to perform and some additional
  51. options. You have to specify at least one option to define
  52. action, and command line must contain only one action option.
  53. Options can be preceded by '-' (minus) sign.
  54. Traditional command line syntax requires all the options to be
  55. typed in place, as a single command line argument. Some of the
  56. options require parameters, such as numerical value or a file
  57. name. Such parameters must follow the options, separated by
  58. spaces, exactly in the order of respective options.
  59.  
  60. The rest of the command line contains a list of files to extract
  61. from archive or to store. This file list can be omitted for
  62. extraction options, such as 't' or 'x', in this case the program
  63. will process all the files in archive; other options makes the
  64. list obligatory.
  65.  
  66. You may use wildcards '?' and '*' in file names both under DOS and
  67. UNIX. Note, however, that UNIX version can not process wildcards
  68. for files which are not in archive, this is done by command
  69. processor - e.g. shell - instead. Consult your manual for the
  70. details of wildcard processing.
  71.  
  72. Here follows the list of options along with their descriptions
  73. (unlike most other implementations this program is case
  74. insensitive, i.e., makes no difference between upper and lowercase
  75. letters):
  76.  
  77.  a - add (store) files to archive, the option is fully analogous
  78.      to traditional 'r' option, and was added to user convenience.
  79.      You have to specify the list of files to be stored.
  80.      Note, that normally files are appended to the end of archive,
  81.      so the archive can contain several files with the same name;
  82.      by default, the program will extract the latest version. Such
  83.      a behavior may be changed by 'c', 'd' and 'w' options.
  84.  
  85.  x - extract files from archive; program extracts specified files,
  86.      if no file name is given, the whole archive will be
  87.      extracted. If the directory name appears in command line, the
  88.      program extracts all of the files and subdirectories in a
  89.      given directory.
  90.  
  91.  t - type archive directory. The files to be processed are defined
  92.      as for the 'x' command.
  93.      The program outputs list of file names, unless 'v' modifier
  94.      is given. With 'v' option each file name is preceded by its
  95.      UNIX access rights mask, numeric user and group identifiers
  96.      and file length in bytes. Usage with 'e' or 'z' option forces
  97.      printing both compressed and original file lengths.
  98.  
  99.  d - the specified files will be deleted from archive; this option
  100.      is for file archives only.
  101.  
  102.  r - read files from disk to archive; the option is an alias for
  103.      'a', it is preserved for the compatibility reasons.
  104.  
  105.  c - the 'a' option implies that archive media contains an
  106.      existing tar archive, or archive file already exists. The 'c'
  107.      option creates a new archive or overwrites old one (if
  108.      any). This option also implies 'a' so you do not need to
  109.      specify it.
  110.  
  111.  y - delete files and directories after storing them into archive.
  112.      This option implies 'a'.
  113.  
  114.  u - update archive. Normally program stores all of the files
  115.      specified. Given option causes tar to store files only if
  116.      they are not present in archive or if the files were
  117.      modified.
  118.      This option implies 'a'.
  119.  
  120.  i - ignore read errors. This option may help (but may not) to
  121.      restore damaged archive.
  122.  
  123.  v - verbose. Normally program works silently; this option
  124.      forces printing of a log with most operations or produces
  125.      a lot of additional information with 't' option.
  126.  
  127.  w - the program will ask for your confirmation before processing
  128.      each file.
  129.  
  130.  e - apply a compression to archive files. The compression
  131.      algorithm has rather good compression ratio, but is
  132.      processor intensive. Besides, you won't be able to
  133.      restore the compressed file by standard 'tar' program - use
  134.      this option carefully.
  135.  
  136.  z - compress files in archive with traditional UNIX algorithm.
  137.      It is much faster than previous option, and it is compatible
  138.      with most Unix systems, so you can extract files with
  139.      'uncompress' or even 'tar' program alone, but this algorithm
  140.      has comparatively low compression ratio.
  141.      You may specify 'bits' factor typing it immediately after
  142.      z letter (e.g. z12); note, that this rule does not follow
  143.      regular command line syntax. See 'compress' program manual
  144.      to understand 'bits' factor meaning.
  145.  
  146.  , - (comma) this option is similar to 'z', but the whole archive
  147.      will be (de)compressed rather than individual files.
  148.  
  149.  . - (dot) this option is similar to ',' (comma) and allows to
  150.      read deflated archive in regular zip or GNU zip format or
  151.      create compressed archives in regular zip format. In the
  152.      latter case it's possible to specify compression level by
  153.      the single digit immediately after dot sign; legal values are
  154.      form 1 to 9 (the more compression level, the better
  155.      compression ratio will be).
  156.  
  157.  s - program will not process '?' and '*' wildcards in archive
  158.      file names.
  159.  
  160.  m - sets modification time of files to current time. By default
  161.      the program sets date and time of modification for extracted
  162.      files exactly as they have before they have been placed into
  163.      archive.
  164.  
  165.  o - option meaning depends on the host operating system, namely
  166.         under UNIX it means -
  167.      omit files owner. By default program tries to restore
  168.      original files owner and group. The option forces tar to set
  169.      the user who invokes tar as files owner, which is
  170.      especially useful when files are marked with zero owner,
  171.      i.e. root'.
  172.         under DOS respectively -
  173.      prevent files overwriting. Since UNIX file names are longer
  174.      than DOS, there is a chance that two or more UNIX files will
  175.      have same DOS names, so they couldn't co-exist onto DOS disk.
  176.      If the 'o' option given, the program will rename extracted
  177.      file if there is a file on the disk with the same name.
  178.      This option can also affect multivolume processing. Namely,
  179.      if two different UNIX files have same DOS names and second 
  180.      file is fragmented between volumes then extents of the second
  181.      file will be appended to first one. Alas, I see no solution
  182.      for this problem.
  183.  
  184.